<%@ page language="java" isELIgnored="false" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-3.2.1.js" ></script>
</head>
	<% 
		String userPhone = "";
		String userPassword = "";
		Cookie[] cs=request.getCookies();
		if(null != cs){
			for(int i=0;i<cs.length;i++){
				Cookie cookie = cs[i];
				String name = cookie.getName();
				if(name.equals("userPhone")){
					userPhone = cookie.getValue();
				}else if(name.equals("userPassword")){
					userPassword = cookie.getValue();
				}
			}
			
			if(null != userPhone && null != userPassword){
				request.getRequestDispatcher("/success.jsp").forward(request, response);
				
			}
		}else{
			System.out.println("使用from提交...");
		}
	%>
<body>
	<form action="/mvn-lzh-servlet02/cookies" action="post">
		用户名 ：<input name="username"/><br/>
		密码 ：<input name="password"/><br/>
		<input type="checkbox" name=""/>1分钟免登录<br/>
		<input type="submit" value="登录"/>
	</form>
</body>
</html>